{include file='comdir/head.html'}
<body>
<form class="form-horizontal" action="javascript:void(0)" id="frm">
    <div class="content">
        <div class="animated fadeInDown">
            <div class="pos"><a href="#" onClick="javascript :history.back(-1);">返回上一页</a></div>
            <div class="config-inner">
                <div class="tab-wrap">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab1" data-toggle="tab">基础配置</a></li>
                        <li><a href="#tab2" data-toggle="tab">上传配置</a></li>
                        <li><a href="#tab3" data-toggle="tab">缩略图配置</a></li>
                        <li><a href="#tab4" data-toggle="tab">水印配置</a></li>
                        <li><a href="#tab5" data-toggle="tab">安全配置</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane fade in active" id="tab1">
                            <div class="tab-intro">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">后台列表显示条数</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="pagesize" value="{$getConfig.pagesize}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">前台列表显示条数</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="clientpagesize" value="{$getConfig.clientpagesize}">
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                        <div class="tab-pane fade" id="tab2">
                            <div class="tab-intro">
                              
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">开启远程上传服务</label>
                                    <div class="col-sm-5">
                                        <div class="radio radio-inline">
                                            <input type="radio" class="is_upload_http" id="is_upload_http1" {if $getConfig.is_upload_http==1} checked {/if}  name="is_upload_http" value="1">
                                            <label for="is_upload_http1">是</label>
                                        </div>
                                        <div class="radio radio-inline">
                                            <input type="radio" class="is_upload_http"  id="is_upload_http2"  {if $getConfig.is_upload_http==0} checked {/if} name="is_upload_http" value="0">
                                            <label for="is_upload_http2">否</label>
                                        </div>
                                    </div>
                                </div>
                                      <script type="text/javascript">
                                        $(".is_upload_http").click(function(){
                                            var value=$(this).val();
                                            if(value==1){
                                                $('.upload_http_show').show();
                                                $('.uploadtoken_show').show();
                                            }else{
                                                $('.upload_http_show').hide();
                                                $('.uploadtoken_show').hide();
                                            }
                                        });
                                      </script>
                                    
                                <div class="form-group upload_http_show" {if $getConfig.is_upload_http==0}style='display: none'{/if}>
                                    <label class="col-sm-2 control-label">上传服务器地址</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="upload_http" value="{$getConfig.upload_http}">
                                        <p class="help-block">要有'/'结束</p>
                                    </div>
                                </div>
                                 <div class="form-group uploadtoken_show" {if $getConfig.is_upload_http==0}style='display: none'{/if}>
                                    <label class="col-sm-2 control-label">远程上传安全码</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="uploadpwd" value="{$getConfig.uploadtoken}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">生成目录格式</label>
                                    <div class="col-sm-5">
                                        <select class="form-control" name="pathFormat">
                                            <option {if $getConfig.pathformat==1}selected{/if} value="1">默认格式</option>
                                            <option {if $getConfig.pathformat==2}selected{/if} value="2">Y/m/d</option>
                                            <option {if $getConfig.pathformat==3}selected{/if} value="3">Y_m_d</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">上传最大文件大小</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="maxSize" value="{$getConfig.maxsize}">
                                        <p class="help-block">单位为MB</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">允许后缀范围</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="exts" value="{$getConfig.exts}">
                                    </div>
                                </div>
                                
                                
                            </div>
                        </div>
                        <div class="tab-pane fade" id="tab3">
                            <div class="tab-intro">
                               <div class="form-group">
                                    <label class="col-sm-2 control-label">是否生成缩略图</label>
                                    <div class="col-sm-5">
                                        <div class="radio radio-inline">
                                            <input type="radio" id="thumb1"  {if $getConfig.thumb==1}checked{/if} name="thumb" value="1">
                                            <label for="thumb1">是</label>
                                        </div>
                                        <div class="radio radio-inline">
                                            <input type="radio" id="thumb2" {if $getConfig.thumb==0}checked{/if}  name="thumb" value="0">
                                            <label for="thumb2">否</label>
                                        </div>
                                    </div>
                                </div>
                               <!--  <div class="form-group">
                                    <label class="col-sm-2 control-label">是否删除原图</label>
                                    <div class="col-sm-5">
                                        <div class="radio radio-inline">
                                            <input type="radio" id="imgdel1" {if $getConfig.imgdel==1}checked{/if} name="imgdel" value="1">
                                            <label for="imgdel1">是</label>
                                        </div>
                                        <div class="radio radio-inline">
                                            <input type="radio" id="imgdel2" {if $getConfig.imgdel==0}checked{/if} name="imgdel" value="0">
                                            <label for="imgdel2">否</label>
                                        </div>
                                    </div>
                                </div> -->
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">缩略图</label>
                                    <div class="col-sm-5">
                                        宽<input type="text" value="{$getConfig.thumbwidth}" class="form-control" style="width: 60px;margin:0 5px;display: inline-block;" name="thumbWidth">px&nbsp;&nbsp;&nbsp;
                                        高<input type="text" value="{$getConfig.thumbheight}" class="form-control" style="width: 60px;margin:0 5px;display: inline-block;" name="thumbHeight">px
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="tab4">
                            <div class="tab-intro">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">是否生成水印图</label>
                                    <div class="col-sm-5">
                                        <div class="radio radio-inline">
                                            <input type="radio" id="water1" {if $getConfig.water==1}checked{/if} name="water" value="1">
                                            <label for="water1">是</label>
                                        </div>
                                        <div class="radio radio-inline">
                                            <input type="radio" id="water2"  {if $getConfig.water==0}checked{/if} name="water" value="0">
                                            <label for="water2">否</label>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">水印类型</label>
                                    <div class="col-sm-5">
                                        <select name="waterType" class="waterType form-control">
                                            <option  {if $getConfig.watertype==0}selected{/if}  value="0">图片</option>
                                            <option  {if $getConfig.watertype==1}selected{/if} value="1">文字</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="water_txt" {if $getConfig.watertype==0}style='display:none'{/if}>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">水印文字</label>
                                        <div class="col-sm-5">
                                            <input type="text" class="form-control" value="{$getConfig.watertxt}" name="waterTXT">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">水印字体</label>
                                        <div class="col-sm-5">
                                            <select name="waterFont" class="form-control">
                                                <option {if $getConfig.waterfont=='FZBSJW.TTF'}selected{/if} value="FZBSJW.TTF">方正报宋简体</option>
                                                <option {if $getConfig.waterfont=='方正北魏楷书繁体.TTF'}selected{/if} value="FZBWKSFW.TTF">方正北魏楷书繁体</option>
                                                <option {if $getConfig.waterfont=='段宁毛笔行书.ttf'}selected{/if} value="段宁毛笔行书.ttf">段宁毛笔行书</option>
                                                <option {if $getConfig.waterfont=='小美好体.ttf'}selected{/if} value="小美好体.ttf">小美好体</option>
                                                <option {if $getConfig.waterfont=='义启春芽.ttf'}selected{/if} value="义启春芽.ttf">义启春芽</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">水印颜色</label>
                                        <div class="col-sm-5">
                                            <select name="waterColor" class="form-control">
                                                <option {if $getConfig.watercolor=='#E22018'}selected{/if}  value="#E22018">红色</option>
                                                <option {if $getConfig.watercolor=='#0C8EF0'}selected{/if}  value="#0C8EF0">蓝色</option>
                                                <option {if $getConfig.watercolor=='#ffffff'}selected{/if}  value="#ffffff">白色</option>
                                                <option {if $getConfig.watercolor=='#00628C'}selected{/if}  value="#00628C">绿色</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">水印字体大小</label>
                                        <div class="col-sm-5">
                                            <select name="waterFontSize" class="form-control">
                                                <option {if $getConfig.waterfontsize==2}selected{/if} value="2">2</option>
                                                <option {if $getConfig.waterfontsize==4}selected{/if} value="4">4</option>
                                                <option {if $getConfig.waterfontsize==6}selected{/if} value="6">6</option>
                                                <option {if $getConfig.waterfontsize==8}selected{/if} value="8">8</option>
                                                <option {if $getConfig.waterfontsize==10}selected{/if} value="10">10</option>
                                                <option {if $getConfig.waterfontsize==12}selected{/if} value="12">12</option>
                                                <option {if $getConfig.waterfontsize==14}selected{/if} value="14">14</option>
                                                <option {if $getConfig.waterfontsize==16}selected{/if} value="16">16</option>
                                                <option {if $getConfig.waterfontsize==18}selected{/if} value="18">18</option>
                                                <option {if $getConfig.waterfontsize==20}selected{/if} value="20">20</option>
                                            </select>
                                        </div>
                                    </div>

                                </div>
                                
                                <div class="form-group img_show_hide" {if $getConfig.watertype==1}style='display:none'{/if}>
                                    <label class="col-sm-2 control-label">显示图片</label>
                                    <div class="col-sm-5">
                                        <img class="show_water" style="max-width: 100px; max-height:100px;" src="{$getConfig.upload_http}{$getConfig.waterimg}" /><br />
                                    </div>
                                </div>
                                <div class="form-group water_img"  {if $getConfig.watertype==1}style='display:none'{/if}>
                                    <label class="col-sm-2 control-label">上传文件</label>
                                    <div class="col-sm-5">
                                        <input type="hidden" value="{$getConfig.waterimg}" name="waterImg" class="water">
                                        <div class="iframe-box btn-blue">
                                            <iframe id="upiframe" frameborder="0" scrolling="no" src="{$_URL}Ups/upone?method=water&classname=water&callback=waterImgback"></iframe>
                                        </div>
                                    </div>
                                </div>
                               <script type="text/javascript">
                                function waterImgback(data){
                                    var classname=data.classname;
                                    $('.'+classname).val(data.img);
                                    $('.img_show_hide').show();
                                    $('.show_'+classname).attr('src',data.imgshow);
                                }
                                </script>
                                <div class="form-group">
                                        <label class="col-sm-2 control-label">水印透明度</label>
                                        <div class="col-sm-5">
                                            <input type="text" value="{$getConfig.waterpha}" class="form-control" name="waterPha">
                                            <p class="help-block">1-100,(注:输入100的话,会很清晰;输入1的话,会很透明,即水印图不明显)</p>
                                        </div>
                                </div>
                                 <div class="form-group">
                                        <label class="col-sm-2 control-label">水印坐标</label>
                                        <div class="col-sm-5">
                                            <table class="radio-table">
                                                <tr>
                                                    <td rowspan="3">
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos" {if $getConfig.watermarkpos==0}checked{/if}  name="waterMarkpos" value="0">
                                                            <label for="waterMarkpos"></label>
                                                        </div>
                                                        <p>随机</p>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos1" name="waterMarkpos"  {if $getConfig.watermarkpos==1}checked{/if} value="1">
                                                            <label for="waterMarkpos1"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos2"  name="waterMarkpos" {if $getConfig.watermarkpos==2}checked{/if} value="2">
                                                            <label for="waterMarkpos2"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos3"  name="waterMarkpos" {if $getConfig.watermarkpos==3}checked{/if} value="3">
                                                            <label for="waterMarkpos3"></label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos4" name="waterMarkpos" {if $getConfig.watermarkpos==4}checked{/if} value="4">
                                                            <label for="waterMarkpos4"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos5"  name="waterMarkpos" {if $getConfig.watermarkpos==5}checked{/if} value="5">
                                                            <label for="waterMarkpos5"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos6"  name="waterMarkpos" {if $getConfig.watermarkpos==6}checked{/if} value="6">
                                                            <label for="waterMarkpos6"></label>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos7" name="waterMarkpos" {if $getConfig.watermarkpos==7}checked{/if} value="7">
                                                            <label for="waterMarkpos7"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos8" name="waterMarkpos" {if $getConfig.watermarkpos==8}checked{/if} value="8">
                                                            <label for="waterMarkpos8"></label>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="radio radio-inline">
                                                            <input type="radio" id="waterMarkpos9"  name="waterMarkpos" {if $getConfig.watermarkpos==9}checked{/if} value="9">
                                                            <label for="waterMarkpos9"></label>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                            </div>
                        </div>
                       <div class="tab-pane fade" id="tab5">
                            <div class="tab-intro">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">后台登陆验证码</label>
                                    <div class="col-sm-5">
                                        <div class="radio radio-inline">
                                            <input type="radio" id="admin_yzm1" {if $getConfig.admin_yzm==1} checked{/if} name="admin_yzm" value="1">
                                            <label for="admin_yzm1">开启</label>
                                        </div>
                                        <div class="radio radio-inline">
                                            <input type="radio" id="admin_yzm2" {if $getConfig.admin_yzm==0} checked{/if} name="admin_yzm" value="0">
                                            <label for="admin_yzm2">关闭</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">登陆错误次数锁定</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="admin_locked" value="{$getConfig.admin_locked}">
                                    </div>
                                </div>
                           
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="btn-pos col-sm-1">
        <input type="button" class="sub btn btn-lg btn-block btn-blue" value="提交">
     </div>
</form>

<script type="text/javascript">
// 水印图片和文字切换
    $(function(){
        $('.waterType').change(function(){
            var type=$(this).val();
            if(type==0){
                $('.img_show_hide').show();
                $('.water_img').show();
                $('.water_txt').hide();
            }else{
                $('.img_show_hide').hide();
                $('.water_img').hide();
                $('.water_txt').show();
            }
        })
    })


var _URL='{$_URL}';
{literal}
$(function(){
    ajax_status=true;
    $('.sub').click(function(){
        var url=_URL+"Config/baselists";
        var formjquery=_ajaxs.from('#frm');
        if(!ajax_status){//防止恶意提交
            return false;
        }
         ajax_status=false;
        //验证结束
        _ajaxs.post(url,'formjquery='+formjquery,function _result(data){
            ajax_status=true;
            layer.msg(data.msg,{icon: 1}, function(){
                if(data.status){
                    window.location.href=url;
                }
            });
        });
    })
})
{/literal}
</script>
</body>
</html>